package com.example.ourradio;

import java.util.Random;

public class Feed {
	public class FeedItem {
		public String mTitle;
		public String mLink;
		public String mSummary;
		public String mSpeechLink;
		public String mKey;
		
		@Override
		public String toString() {
			return mTitle;
		}
	}
	
	public String mTitle;
	public String mLink;
	public FeedItem[] mItems;
	private int mActivePosition;
	
	private Random mRand = new Random();

	public Feed() {
		mItems = new FeedItem[0];
		mActivePosition = -1;
	}
	
	public void incPosition() {
		mActivePosition = (mActivePosition + 1) % mItems.length;
	}
	
	public void randomPosition() {
		mActivePosition = mRand.nextInt(mItems.length);
	}
	
	public FeedItem getActiveItem() {
		return mItems[mActivePosition];
	}
	
	public int getActivePosition() {
		return mActivePosition;
	}
	
	public void setActivePosition(int activePosition) {
		mActivePosition = activePosition;
	}
}
